package com.alibaba.cirtus.ots.application.adapter.ability.model.enums;

public enum NykFailRecordEnum {

    FORECAST(1,"预报单"),
    SALE(2,"销售调拨"),
    TRANSFER(3,"计划调拨"),
    UPDATE_SAP_CODE(4,"修改sapcode");
    private int value;
    private String desc;
    NykFailRecordEnum(int value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    /**
     * 通过code获取枚举
     *
     * @param code code
     * @return by code
     */
    public static NykFailRecordEnum getByCode(int code) {
        for (NykFailRecordEnum nykFailRecordEnum : values()) {
            if (code==nykFailRecordEnum.getValue()) {
                return nykFailRecordEnum;
            }
        }
        return null;
    }

}
